﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMain.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ShoppingCart.WebSite.Cliente.Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Style/smoothness/jquery-ui-1.7.1.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Style/js/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function() {
            $("#tabs").tabs();
        });
    </script>

    <script type="text/javascript">
        $(document).ready(function() {
            $('#ctl00_ContentPlaceHolder1_txtFechaNacimiento').datepicker({
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true
            });
        });
    </script>

    <script type="text/javascript">
        function ValidarForm() {
            var val = true;
            var email = document.getElementById('<%= txtEmail.ClientID %>').value;
            var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;

            if (document.getElementById('<%= txtNumeroDocumento.ClientID %>').value == '') {
                val = false;
            }

            if (document.getElementById('<%= txtNombres.ClientID %>').value == '') {
                val = false;
            }

            if (document.getElementById('<%= txtApellidos.ClientID %>').value == '') {
                val = false;
            }

            if (document.getElementById('<%= txtEmail.ClientID %>').value == '') {
                val = false;
            } else {
                if (pattern.test(email)) {
                    val = val;
                } else {
                    val = false;
                }
            }

            if (document.getElementById('<%= txtDireccion.ClientID %>').value == '') {
                val = false;
            }

            if (!val) {
                alert('Debe completar correctamente los campos que son obligatorios(*).');
                return false;
            }
            else {
                return true;
            }
        }      
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="RightSide">
        <div class="bredCrum">
            <h4>
                <a class="select">Datos del Cliente</a>
            </h4>
        </div>
        <div id="tabs" style="min-height: 500px; width: 690px;">
            <ul class="texto">
                <li><a href="#tabs-1">INFORMACION DE PERFIL</a></li>
                <li><a href="#tabs-2">CAMBIAR CONTRASEÑA</a></li>
            </ul>
            <div id="tabs-1">
                <fieldset style="padding: 10px; padding-left: 20px;" class="texto">
                    <legend>Ingresar sus datos de contacto: </legend>
                    <br />
                    <table cellspacing="5" cellpadding="5">
                        <tr>
                            <td align="center" rowspan="5" valign="middle">
                                <asp:Image ID="imgFoto" runat="server" ImageUrl="~/Style/images/cliente.png" Height="128px"
                                    Width="128px" />
                                <br />
                                <br />
                                <asp:FileUpload ID="fuFoto" runat="server" Width="150px" /><br />
                                <small>( 1MB max. )</small>
                            </td>
                            <td colspan="2">
                                N&uacute;mero de DNI <b>(*)</b><br />
                                <asp:TextBox ID="txtNumeroDocumento" runat="server" MaxLength="8" Width="160px" AutoPostBack="True"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwNumeroDocumento" runat="server" TargetControlID="txtNumeroDocumento"
                                    WatermarkText="Número" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Nombres <b>(*)</b><br />
                                <asp:TextBox ID="txtNombres" runat="server" Width="160px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwNombres" runat="server" TargetControlID="txtNombres"
                                    WatermarkText="Ingresar su Nombre" WatermarkCssClass="watermarked" />
                            </td>
                            <td>
                                Apellidos <b>(*)</b><br />
                                <asp:TextBox ID="txtApellidos" runat="server" Width="252px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwApellidos" runat="server" TargetControlID="txtApellidos"
                                    WatermarkText="Ingresar sus Apellidos" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                E-mail <b>(*)</b><br />
                                <asp:TextBox ID="txtEmail" runat="server" Width="420px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwEmail" runat="server" TargetControlID="txtEmail"
                                    WatermarkText="Direccion de correo" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                N&uacute;mero de RUC<br />
                                <asp:TextBox ID="txtRuc" runat="server" Width="160px" MaxLength="11"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwRuc" runat="server" TargetControlID="txtRuc"
                                    WatermarkText="Numero RUC" WatermarkCssClass="watermarked" />
                            </td>
                            <td>
                                Raz&oacute;n Social<br />
                                <asp:TextBox ID="txtRazonSocial" runat="server" Width="252px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwRazonSocial" runat="server" TargetControlID="txtRazonSocial"
                                    WatermarkText="Ingresar su Razón Social" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:UpdatePanel ID="upInfo" runat="server">
                                    <ContentTemplate>
                                        <span style="padding-right: 50px;">Departamento <b>(*)</b></span> <span style="padding-right: 60px;">
                                            Provincia <b>(*)</b></span> Distrito <b>(*)</b><br />
                                        <asp:DropDownList ID="ddlDepartamento" runat="server" Width="140px" AutoPostBack="True"
                                            OnSelectedIndexChanged="DdlDepartamentoSelectedIndexChanged">
                                        </asp:DropDownList>
                                        &nbsp;<asp:DropDownList ID="ddlProvincia" runat="server" Width="140px" AutoPostBack="True"
                                            OnSelectedIndexChanged="DdlProvinciaSelectedIndexChanged">
                                        </asp:DropDownList>
                                        &nbsp;<asp:DropDownList ID="ddlDistrito" runat="server" Width="138px">
                                        </asp:DropDownList>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="ddlDepartamento" EventName="Selectedindexchanged" />
                                        <asp:AsyncPostBackTrigger ControlID="ddlProvincia" EventName="Selectedindexchanged" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Telefono
                                <br />
                                <asp:TextBox ID="txtTelefono" runat="server" Width="160px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwTelefono" runat="server" TargetControlID="txtTelefono"
                                    WatermarkText="Ingresar su Telefono" WatermarkCssClass="watermarked" />
                            </td>
                            <td colspan="2">
                                Dirección de Domicilio <b>(*)</b><br />
                                <asp:TextBox ID="txtDireccion" runat="server" Width="420px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwDireccion" runat="server" TargetControlID="txtDireccion"
                                    WatermarkText="Ingresar su direccion" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ceular
                                <br />
                                <asp:TextBox ID="txtCelular" runat="server" Width="160px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwCelular" runat="server" TargetControlID="txtCelular"
                                    WatermarkText="Ingresar su Celular" WatermarkCssClass="watermarked" />
                            </td>
                            <td>
                                Fecha Nac.<br />
                                <asp:TextBox ID="txtFechaNacimiento" runat="server" Width="160px"></asp:TextBox>
                            </td>
                            <td>
                                Sexo<br />
                                <asp:RadioButtonList ID="rblSexo" runat="server" RepeatDirection="Horizontal" Width="180px">
                                    <asp:ListItem Value="M" Selected="True">Masculino</asp:ListItem>
                                    <asp:ListItem Value="F">Femenino</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                Ocupaci&oacute;n Laboral<br />
                                <asp:TextBox ID="txtOcupacion" runat="server" Width="585px" TextMode="MultiLine"
                                    Height="50px"></asp:TextBox>
                                <cc1:TextBoxWatermarkExtender ID="tbwOcupacion" runat="server" TargetControlID="txtOcupacion"
                                    WatermarkText="Ingresar su(s) Ocupacion(es) laboral(es)" WatermarkCssClass="watermarked" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td align="right">
                                <asp:Button ID="btnGuardar" runat="server" Text="Guardar Información" OnClick="BtnGuardarClick"
                                    Width="180px" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
            <div id="tabs-2">
                <asp:UpdatePanel ID="upPassword" runat="server">
                    <ContentTemplate>
                        <fieldset style="padding: 10px; padding-left: 20px;" class="texto">
                            <legend>Ingresar los datos para cambiar la contraseña: </legend>
                            <br />
                            <asp:ChangePassword ID="logChangePassowrd" runat="server" CancelDestinationPageUrl="~/Cliente/Default.aspx"
                                ChangePasswordTitleText="" ContinueDestinationPageUrl="~/Cliente/Default.aspx"
                                PasswordLabelText="Contraseña actual:" SuccessText="Se ha cambiado su contraseña satisfactoriamente."
                                SuccessTitleText="" Width="600px" CssClass="texto">
                                <CancelButtonStyle Width="100px" />
                                <ContinueButtonStyle Width="100px" />
                                <SuccessTextStyle Font-Bold="True" HorizontalAlign="Center" />
                                <ChangePasswordButtonStyle Width="180px" />
                                <TextBoxStyle Width="200px" Height="20px" />
                            </asp:ChangePassword>
                        </fieldset>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
    <div class="clr">
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
</asp:Content>
